<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
	<package name="default" extends="struts-default">     
        <interceptors>
            <interceptor name="loginInterceptor" class="main.java.org.dss.lm.admin.interceptor.LoginInterceptor"></interceptor>
        </interceptors>
        
        <!-- Vivek Actions - START -->
    <!-- **************************** START: LOGIN MODULE **************************** -->
       
        <!-- **** START: ACTION - CHECKING FOR CREATED SESSION AND RE-DIRECTION **** -->
        <action name="default" class="main.java.org.dss.lm.admin.controller.login.DefaultAction">
        	<interceptor-ref name="loginInterceptor"></interceptor-ref>
            <interceptor-ref name="defaultStack"></interceptor-ref>
            <result name="input">index.jsp</result>
            <result name="success">mainPage.jsp</result>            
        </action>
        <!-- **** END: ACTION - CHECKING FOR CREATED SESSION AND RE-DIRECTION **** -->        
        <!-- **** START: ACTION - CHECKING FOR AUTHENTICITY **** -->
        <action name="login" class="main.java.org.dss.lm.admin.controller.login.LoginAction" method="checkAuthentication">
            <interceptor-ref name="loginInterceptor"></interceptor-ref>
            <interceptor-ref name="defaultStack"></interceptor-ref>
            <result name="input">index.jsp</result>
            <result name="success">mainPage.jsp</result>  
        </action>   
        
        <action name="globalLogout" class="main.java.org.dss.lm.admin.controller.login.LoginAction" method="globalLogout">
            <result name="input">index.jsp</result>
            <result name="success">index.jsp</result>  
        </action>          
        <!-- **** END: ACTION - CHECKING FOR AUTHENTICITY **** --> 
                 
    <!-- **************************** END: LOGIN MODULE **************************** -->
    
    <!-- **************************** START: ADMIN MODULE **************************** -->    
        <!-- **** START: ACTION - CHECKING FOR CREATED SESSION AND RE-DIRECTION **** -->
        <action name="addUser" class="main.java.org.dss.lm.admin.controller.admin.UserAction" method="addUser">
        <result name="input">addUser.jsp</result>
        <result name="success" type="chain">allUser</result>
        </action>
        
        <action name="allUser" class="main.java.org.dss.lm.admin.controller.admin.EditOrDeleteUserDetails" method="allUser">        
        <result name="input">addUser.jsp</result> 
        <result name="success">allUser.jsp</result>           
        </action>
        
        <action name="editOrDeleteUserDetails" class="main.java.org.dss.lm.admin.controller.admin.EditOrDeleteUserDetails" method="editOrDeleteUserDetails">        
        <result name="input">addUser.jsp</result> 
        <result name="edit">editUser.jsp</result>
        <result name="delete">deleteUser.jsp</result>                   
        </action>
        
        <action name="updateUser" class="main.java.org.dss.lm.admin.controller.admin.UserAction" method="updateUser">
        <result name="input" type="chain">allUser</result> 
        <result name="success" type="chain">allUser</result>           
        </action>
        
        <action name="deleteUser" class="main.java.org.dss.lm.admin.controller.admin.EditOrDeleteUserDetails" method="deleteUser">
        <result name="input" type="chain">allUser</result>  
        <result name="success" type="chain">allUser</result>           
        </action>
        <!-- **** END: ACTION - CHECKING FOR CREATED SESSION AND RE-DIRECTION **** --> 
    <!-- **************************** END: ADMIN MODULE **************************** -->
    
    <!-- Vivek Actions - END --> 
    
    <!-- Vipul Actions - START -->
    
    <action name="addTrx1" class="com.lm.ledger.action.PopulateAction" method="getLocns">
         	<result>/pages/ledger/addTransaction.jsp</result>  
         </action>       
         <action name="saveTrx" class="com.lm.ledger.action.AddTransaction" method="save">
         	<result name="input">/pages/ledger/addTransaction.jsp</result> 
         	<result name="error">/pages/ledger/addTransaction.jsp</result> 
         	<result name="success">/pages/ledger/viewAllUserTransaction.jsp</result> 
         </action>
         
         <action name="editTrxPage" class="com.lm.ledger.action.EditTransaction" method="getAllTrx">
         	<result name="success">/pages/ledger/SearchEditTrx.jsp</result>  
         </action> 
         <action name="searchEditTrx" class="com.lm.ledger.action.EditTransaction" method="searchEditTrx">
         	<result name="success">/pages/ledger/SearchEditTrx.jsp</result>  
         </action>
         <action name="saveEditTrx" class="com.lm.ledger.action.EditTransaction" method="saveEditTrx">
         	<result name="success">/pages/ledger/viewAllUserTransaction.jsp</result>  
         	<result name="input">/pages/ledger/index.jsp</result>
         	<result name="error">/pages/ledger/editTransaction.jsp</result>
         </action>
         <action name="editTrx" class="com.lm.ledger.action.EditTransaction" method="editTrx">
         	<result name="success">/pages/ledger/editTransaction.jsp</result>  
         </action>
         <action name="rejectTrx" class="com.lm.ledger.action.EditTransaction" method="rejectTrx">
         	<result name="success">/pages/ledger/viewAllUserTransaction.jsp</result>  
         	<result name="input">/pages/ledger/index.jsp</result>
         	<result name="error">/pages/ledger/editTransaction.jsp</result>
         </action>
         
         
         <action name="appTrxPage" class="com.lm.ledger.action.ApproveTransaction" method="getTrxToApprove">
         	<result name="success">/pages/ledger/SearchApproveTrx.jsp</result>  
         </action>  
         <action name="saveApproveTrx" class="com.lm.ledger.action.ApproveTransaction" method="saveApproveTrx">
         	<result name="success" type="redirectAction"> appTrxPage</result>
         </action>  
          <action name="appTrx" class="com.lm.ledger.action.ApproveTransaction" method="appTrx">
         	<result name="success">/pages/ledger/approveTransaction.jsp</result>  
         </action> 
         
         <!-- Vipul Actions - END -->
         
         <!-- Sachin Actions - START  -->
         
         <action name="addLocation" class="com.lm.location.action.AddLocation" method="addLocation">
         	<result name="success" type="redirectAction">searchDefaultLocationToView</result>
         </action>
          <action name="searchDefaultLocationToEdit" class="com.lm.location.action.SearchLocation" method="defaultSearchLocation">
         	<result name="success">/pages/location/searchEditLocation.jsp</result>
         </action>
         <action name="searchDefaultLocationToDelete" class="com.lm.location.action.SearchLocation" method="defaultSearchLocation">
         	<result name="success">/pages/location/searchDeleteLocation.jsp</result>
         </action>
         <action name="getEditLocation" class="com.lm.location.action.EditLocation" method="getlocationToEdit">
         	<result name="success">pages/location/editLocation.jsp</result>
         </action>
          <action name="searchLocation" class="com.lm.location.action.SearchLocation" method="searchLocation">
         	<result name="success">pages/location/searchLocation.jsp</result>
         </action>
          <action name="editLocation" class="com.lm.location.action.EditLocation" method="updateLocation">
         	<result name="success" type="redirectAction">searchDefaultLocationToEdit</result>
         </action>
         <action name="deleteLocation" class="com.lm.location.action.DeleteLocation" method="deleteLocation">
         	<result name="success" type="redirectAction">searchDefaultLocationToDelete</result>
         </action>
         
         <action name="approveLocation" class="com.lm.location.action.ApproveLocation" method="approveLocation">
         	<result name="success" type="redirectAction">searchDefaultLocationToApprove</result>
         </action>
         <action name="viewLocation" class="com.lm.location.action.ViewLocation" method="getLocationToView">
         	<result name="success">/pages/location/viewLocation.jsp</result>
         </action>
         <action name="searchDefaultLocationToApprove" class="com.lm.location.action.SearchLocation" method="searchToApproveLocation">
         	<result name="success">/pages/location/searchApproveLocation.jsp</result>
         </action>
  		 <action name="searchDefaultLocationToView" class="com.lm.location.action.SearchLocation" method="defaultSearchLocation">
         	<result name="success">/pages/location/searchViewLocation.jsp</result>
         </action>
         
         <!--  new action by Sachin -->         
         
         <action name="stateList" class="com.lm.location.action.AddLocation" method="staList">
	     	<result name="success">/pages/location/addLocation.jsp</result>
	     </action>
	     
	     <action name="dstList" class="com.lm.location.action.AddLocation" method="dstList">
	     	<result name="success">/pages/location/addLocation.jsp</result>
	     </action>
         
         <!--  Sachin Actions -  END -->
    
    </package> 
</struts>